package com.heima.feigns.user;

import com.heima.model.user.pojos.ApUser;
import com.heima.model.user.pojos.ApUserFollow;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description:
 * @Version: V1.0
 */
@FeignClient("leadnews-user")
public interface UserFeign {

    /**
     * 根据用户id和关注作者的id查询
     *
     * @param userId
     * @param followId
     * @return
     */
    @GetMapping("/api/v1/user_follow/one")
    public ApUserFollow findByUserIdAndFollowId(@RequestParam("userId") Integer userId, @RequestParam("followId") Integer followId);


    /**
     * 根据ID查询用户信息
     * @param id
     * @return
     */
    @GetMapping("/api/v1/user/{id}")
    ApUser findUserById(@PathVariable("id") Long id);


}
